--- tools/src/perl-5.8.7/Makefile.SH.orig	2018-01-10 10:15:38.382824162 +0800
+++ tools/src/perl-5.8.7/Makefile.SH	2018-01-10 10:39:22.102911060 +0800
@@ -248,7 +248,7 @@
 ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
 DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
 
-libs = $perllibs $cryptlib
+libs = $perllibs $cryptlib -lm
 
 public = perl\$(EXE_EXT) $suidperl utilities translators
 
@@ -1080,7 +1080,7 @@
 # When done, touch perlmain.c so that it doesn't get remade each time.
 .PHONY: depend
 depend: makedepend
-	sh ./makedepend MAKE=$(MAKE)
+	bash ./makedepend MAKE=$(MAKE)
 	- test -s perlmain.c && touch perlmain.c
 	cd x2p; $(MAKE) depend
 
--- tools/src/perl-5.8.7/makedepend.SH.orig	2018-01-10 10:37:25.312899605 +0800
+++ tools/src/perl-5.8.7/makedepend.SH	2018-01-10 10:53:48.841986501 +0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/bash
 case $PERL_CONFIG_SH in
 '')
 	if test -f config.sh; then TOP=.;
@@ -167,6 +167,7 @@
             -e '/^#.*<builtin>/d' \
             -e '/^#.*<built-in>/d' \
             -e '/^#.*<command line>/d' \
+            -e '/^#.*<command-line>/d' \
 	    -e '/^#.*"-"/d' \
 	    -e '/: file path prefix .* never used$/d' \
 	    -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \
